<?
include 'render.php';

if (isset($_POST['xml']) && $_GET['debug']=='32167') file_put_contents('x/main/gx.xml',$_POST['xml']);
$gx=new gxlib('main',isset($_GET['debug'])?true:false);



if (!isset($_GET['all']))
{
	echo "<img src='?all' align=left>
<form method=post>
	<textarea name='xml' rows=20 cols=120>".htmlspecialchars($gx->innerXML)."</textarea><br>
	<input type='submit' value='Save'>
</form><br>".nl2br($gx->logLines);
} else imagepng($gx->graph);